import 'package:flutter/material.dart';
import 'package:xuance/constant.dart';

class BaseColorList {
  Color color = Colors.blue;
}

extension Ext on List<BaseColorList> {
  void makeColors() {
    for (int i = 0; i < length; i++) {
      var pieColors = [c_green, c_orange, const Color(0xff0098ff), c_CCCCCF];
      this[i].color = pieColors[i % pieColors.length];
      if (i > 0 && this[i].color == this[i - 1].color) {
        this[i].color = pieColors[(i + 1) % pieColors.length];
      }
    }
  }
}
